<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="zhcms.admin.*" %> 
<%@ page import="zhcms.framework.*" %> 
<%@ include file="include/adminhead.jsp" %>
<%
request.setCharacterEncoding("utf-8");
String action=request.getParameter("action");
GyUserLoginValidate gycheck=new GyUserLoginValidate();
int ischeck=gycheck.UserLoginValidate(request, response);
if(ischeck==0)
{
		try{
			out.println("<script language='javascript'>alert('对不起！，您还没有登陆');location.href=\"index.jsp\";</script>");
		}
		catch(Exception e){
			e.printStackTrace();
		}
} 

if(action=="main" || action==null || action.length()<=0)
{
	GySystemInfo gysi=new GySystemInfo();
	ArrayList<HashMap<String, String>> gySystemInfo=new ArrayList<HashMap<String, String>>();
	gySystemInfo=gysi.getSysteminfo();
	//System.out.println("gySystemInfo=="+gySystemInfo.size());
	if(gySystemInfo.size()>0)
	{
		Map<String,String> iGySysteminfo=new HashMap<String,String>();
		iGySysteminfo=gySystemInfo.get(0);
		
		String id=iGySysteminfo.get("Id");
		String SInfo=iGySysteminfo.get("InfoContent");
		String ishtml=iGySysteminfo.get("ishtml");
		
	//	System.out.println("id=="+id +"   [SInfo====="+SInfo+"]" +"ishtml=="+ishtml);
		String[] sinfo;
		sinfo=new String[16];
		String[] tempinfo = null;
		GySplit d = new GySplit();
		d.tool(SInfo, ",");
		tempinfo = d.Show();
		d = null;
		if(tempinfo.length<16)
		{
			for(int i=0;i<tempinfo.length;i++)
			{
				sinfo[i]=tempinfo[i];
			}
		}
		else
		{
			for(int i=0;i<16;i++)
			{
				sinfo[i]=tempinfo[i];
			}
		}
%>
<script>
function change(obj,i) {
he=parseInt(obj.style.height);
if (he>=80&&he<=400)
  obj.style.height=he+i+'px';
else
  obj.style.height='80px';
}
</script>
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr>
		<td width="100%" height=30 bgcolor=f7f3f7 colspan=2>&nbsp;&nbsp;<B>说明</B>：这里的设置代表了系统中的全局设置，如果需要对某个版块或用户组进行单独设置，请到各自的管理中心操作</td>
    </tr>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" align="center" class="tableBorder">
<form action="/zhcms!action!GySystemInfoAction(save).do" method="post" id="form1" name="form1">
    <tr>
      <th height=25 colspan=2><B>基本设置</b></th>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统名称</u>&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="name" size="35" value="<%=sinfo[0]%>"></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统URL</u>&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="url" size="35" value="<%=sinfo[11]%>"></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统是否打开</u>&nbsp;</td>
      <td width="60%">&nbsp;开<input type="radio" name="isopen" value="1" <%if(sinfo[1].equals("1")){ out.println("checked");} %>> 关<input type="radio" name="isopen" value="0" <%if(sinfo[1].equals("0")){ out.println("checked");} %>></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>关闭时的公告语</u>&nbsp;</td>
      <td width="60%">&nbsp;<textarea name="message" cols="30" rows="3" wrap="VIRTUAL"><%=sinfo[2]%></textarea><br>&nbsp;<a href="javascript:change(document.all.message,-20)"><img src="images/minus.gif" border=0 title="缩小文本框"></a>&nbsp;&nbsp;<a href="javascript:change(document.all.message,20)"><img src="images/plus.gif" border=0 title="放大文本框"></a></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统是否定时打开</u>&nbsp;</td>
      <td width="60%">&nbsp;是<input type="radio" name="isclose" value="1" <%if(sinfo[3].equals("1")){ out.println("checked");} %>> 否<input type="radio" name="isclose" value="0" <%if(sinfo[3].equals("0")){ out.println("checked");} %>></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>定时开关的时间</u>&nbsp;<br>起止小时用符号“|”分开&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="opentime" size="10" value="<%=sinfo[4]%>"></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>是否限制总在线人数</u>&nbsp;</td>
      <td width="60%">&nbsp;是<input type="radio" name="isonline" value="1" <%if(sinfo[5].equals("1")){ out.println("checked");} %>> 否<input type="radio" name="isonline" value="0" <%if(sinfo[5].equals("0")){ out.println("checked");} %>></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统总在线人数上限</u>&nbsp;<br>0为不限制&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="online" size="10" value="<%=sinfo[6]%>"></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统是否使用html模式</u>&nbsp;</td>
      <td width="60%">&nbsp;是<input type="radio" name="ishtml" value="1" <%if(ishtml.equals("1")){ out.println("checked");} %>> 否<input type="radio" name="ishtml" value="0" <%if(ishtml.equals("0")){ out.println("checked");} %>></td>
    </tr>
    <tr>
      <th height=25 colspan=2><B>注册设置</b></th>
    </tr>
    <tr>
      <td width="40%" align=right><u>是否开启注册</u>&nbsp;</td>
      <td width="60%">&nbsp;是<input type="radio" name="isreg" value="1" <%if(sinfo[7].equals("1")){ out.println("checked");} %>> 否<input type="radio" name="isreg" value="0" <%if(sinfo[7].equals("0")){ out.println("checked");} %>></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>是否EMAIL只允许注册一个ID</u>&nbsp;</td>
      <td width="60%">&nbsp;是<input type="radio" name="isemail" value="1" <%if(sinfo[8].equals("1")){ out.println("checked");} %>> 否<input type="radio" name="isemail" value="0" <%if(sinfo[8].equals("0")){ out.println("checked");} %>></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>注册需要管理员验证</u>&nbsp;</td>
      <td width="60%">&nbsp;是<input type="radio" name="isadmin" value="0" <%if(sinfo[9].equals("0")){ out.println("checked");} %>> 否<input type="radio" name="isadmin" value="1" <%if(sinfo[9].equals("1")){ out.println("checked");} %>></td>
    </tr>
    <tr>
      <th height=25 colspan=2><B>浏览设置</b></th>
    </tr>
    <tr>
      <td width="40%" align=right><u>每页显示记录数</u>&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="pagecount" size="5" value="<%=sinfo[10]%>">&nbsp;条</td>
    </tr>
    <tr>
      <th height=25 colspan=2><B>邮件设置</b></th>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统EMAIL</u>&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="mail" value="<%=sinfo[12]%>"></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统EMAIL登陆名</u>&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="mail_n" value="<%=sinfo[13]%>"></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统EMAIL密码</u>&nbsp;</td>
      <td width="60%">&nbsp;<input type="password" name="mail_p" value="<%=sinfo[14]%>"></td>
    </tr>
    <tr>
      <td width="40%" align=right><u>系统EMAIL smtp服务器地址</u>&nbsp;</td>
      <td width="60%">&nbsp;<input type="text" name="mail_s" value="<%=sinfo[15]%>"></td>
    </tr>
    <tr bgcolor="f7fbff" align=center>
      <td colspan="2" height="25"><input type="hidden" name="id" value="<%=id%>"><input type="hidden" name="action" value="save"><input type="hidden" name="canshu" value="save"><input type="submit" name="Submit" value="确认">&nbsp;&nbsp;<input type="reset" name="Submit2" value="重置"></td>
    </tr>
</form>
</table>
<% 
	}
}
else 
{
	
}
%>
<%@ include file="include/adminfoot.jsp" %>
